{% extends 'framework/layout.html' %}
{% load comments_tags %}

{% block main %}
    <article class="post post-{{ article.pk }}">
        <header class="entry-header">
            <h1 class="entry-title">{{ article.title }}</h1>
            <div class="entry-meta">
                <span class="post-category"><a href="#">{{ article.category.name }}</a></span>
                <span class="post-date"><a href="#"><time class="entry-date"
                                                          datetime="{{ article.created_time }}">{{ article.created_time }}</time></a></span>
                <span class="post-author"><a href="#">{{ article.author }}</a></span>
                <span class="comments-link"><a href="#comment-area">{{ article.comment_set.count }} 评论</a></span>
                <span class="views-count"><a href="#">{{ article.counter }} 阅读</a></span>
            </div>
        </header>
        <div class="entry-content clearfix">
            <p class="markdown">{{ article.body_html|safe }}</p>

        </div>
    </article>
    <section class="comment-area" id="comment-area">
        <hr>

        <h3>发表评论</h3>
        {% show_comment_form article %}
        <div class="comment-list-panel">
            {% show_comments article %}
        </div>
    </section>
{% endblock main %}

{% block rightbar %}
    {% if article.toc %}
        <div class="widget widget-content">
            <h3 class="widget-title">文章目录</h3>
            <div class="toc">
                <ul>
                    {{ article.toc|safe }}
                </ul>
            </div>
{#        <a href="javascript:void(0);" class="top">返回顶部</a>#}
        </div>
    {% endif %}

{% endblock rightbar %}